package tools;

import java.util.Random;

public class Math {
	
	public static Random random = new Random();

	/* returns random integer in interval [min, max] */	
    public static int randomInt(int min, int max){
        //Random random = new Random();
        if(min <= max){
            return min  + random.nextInt(max - min + 1);
        } else {
            return max;
        }
    }

    /* returns random double in interval [min, max] */
    public static double randomDouble(double min, double max){
        //Random random = new Random();
        if(min <= max){
            return random.nextDouble()*max + min;
        } else {
            return max;
        }
    }
}
